<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <!-- 引包 -->
    <script src="../js/vue.js"></script>
</head>

<body>
    <div id="app">
        <h1>渲染列表----显示人的名字</h1>
        <!-- 加入列表的人名有1000个 -->
        <ul>
            <li>貂蝉</li>
            <li>吕布</li>
            <li>刘备</li>
            <li>孙权</li>
            <li>鲁班七号</li>
            <li>妲己</li>
        </ul>
        <h2>v-for指令的基本使用</h2>
       
        <ul>
          
            <li v-for="item in students">
                  {{item.name}}
            </li>
        </ul>

        <p v-for="num in arr">
            {{num}}
        </p>
    </div>
</body>

</html>
<script>
    //关联VM
    const VM = new Vue({
        el: '#app',
        data: {
            //数据
            students: [
                { id: 1, name: "貂蝉" },
                { id: 2, name: '妲己' },
                { id: 3, name: '大桥' },
                { id: 4, name: '小乔' },
                { id: 5, name: '周瑜' },
                { id: 1, name: "貂蝉" },
                { id: 2, name: '妲己' },
                { id: 3, name: '大桥' },
                { id: 4, name: '小乔' },
                { id: 5, name: '周瑜' }
            ],
            arr:[1,2,3,4]
        }
    });

    
</script>